Skip to content

fix(android): report React Native wrapper type on every selectPlacements call - #357

Merged
nickolas-dimitrakas merged 2 commits into
mainfrom
fix/android-rokt-wrapper-sdk-type
Jul 29, 2026
Merged

fix(android): report React Native wrapper type on every selectPlacements call#357
nickolas-dimitrakas merged 2 commits into
mainfrom
fix/android-rokt-wrapper-sdk-type

Conversation

@denischilik

Copy link
Copy Markdown
Contributor

Summary

On Android, the React Native wrapper SDK type was reported to mParticle only once, in the MPRoktModuleImpl constructor. That one-shot call is silently dropped in two common cases:

  • MParticle.getInstance() is still null when the native module is created (mParticle not started yet), and the call is never retried.
  • The Rokt kit has not finished initializing when the call fires. KitManagerImpl.setWrapperSdkVersion only forwards to already-active kits and, unlike iOS (which queues kit calls until kits are initialized and replays them), Android has no queuing, so the value is lost.

As a result the Rokt SDK falls back to reporting android as the framework type for React Native integrations, while iOS correctly reports reactNative. iOS already re-sends the wrapper type on every placement call; this change aligns Android with that behavior by reporting the wrapper type at the start of every selectPlacements call (both old and new architecture), in addition to module creation.

Testing Plan

  • Added unit tests for MPRoktModuleImpl covering: wrapper type reported at module creation, reported on each subsequent call, and no crash when mParticle is not started.
  • ./gradlew test, ./gradlew ktlintCheck, ./gradlew lint, and trunk check all pass locally.
  • Suggested additional validation: run the sample app with the Rokt kit configured and confirm SDK diagnostics report reactNative as the framework type on Android.

Master Issue

Closes https://go.mparticle.com/work/REPLACEME

…nts call

The wrapper SDK type was only reported once at module creation. If
MParticle was not started yet, or the Rokt kit had not finished
initializing, the call was silently dropped and never retried, so the
framework type fell back to android. iOS already re-sends the wrapper
type on every placement call; this aligns Android with that behavior.
@denischilik
denischilik requested a review from a team as a code owner July 20, 2026 16:34
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Low-risk telemetry/diagnostics alignment with iOS; no changes to placement UI, auth, or purchase flows.

Overview
Fixes Android Rokt integrations reporting android instead of reactNative by re-sending the mParticle wrapper SDK type when it matters, not only when the native module is constructed.

setWrapperSdk() is now a dedicated method on MPRoktModuleImpl (still invoked from init) and is called again at the start of selectPlacements in both old- and new-architecture MPRoktModule, matching iOS. That retries after mParticle startup and kit init, when the earlier one-shot call was often dropped.

Adds MPRoktModuleImplTest to verify reporting on module creation, on repeated calls, and safe no-op when MParticle is not started.

Reviewed by Cursor Bugbot for commit 08ef9da. Bugbot is set up for automated code reviews on this repo. Configure here.

Resolve conflict in new-arch MPRoktModule by keeping SDK 6 rokt
accessor and re-reporting wrapper SDK type on selectPlacements.
@nickolas-dimitrakas
nickolas-dimitrakas merged commit 1085151 into main Jul 29, 2026
11 checks passed
@nickolas-dimitrakas
nickolas-dimitrakas deleted the fix/android-rokt-wrapper-sdk-type branch July 29, 2026 17:40
@rokt-releases rokt-releases Bot mentioned this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants